-
-
Notifications
You must be signed in to change notification settings - Fork 338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Toolkit] Introduce the UX Toolkit ✨ #2539
base: 2.x
Are you sure you want to change the base?
Conversation
Let's get to work! 👏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First comments on "form" only, just to warn early about some details
->defaultValue('default') | ||
->end() | ||
->stringNode('prefix') | ||
->defaultValue('ux') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefix ux
is reserved for components from symfony/ux-
packages:
->defaultValue('ux') | |
->defaultNull() |
Wow, that's a awesome PR! 👏 |
Following numerous discussions with various people, I'm opening this PR as a draft for a potential ux-toolkit component. This is the result of a joint reflection with @Kocal and @smnandre .
I’m not speaking on their behalf, but summarizing my interpretation of our discussions. Of course, @Kocal and @smnandre, feel free to correct, adjust, or add anything as needed.
Why?
Saving time
Creating Twig components like Badge or Button seems to be a very common step. The same work appears to be done over and over again, with minor differences from one company to another.
Providing a "packaged" toolkit would allow these companies and developers to save time by starting from ready-made templates.
Simplifying the process
Today, a beginner coming to Symfony has a lot to learn. Onboarding on a Symfony project can feel overwhelming, so it makes sense to offer them the most pleasant experience possible—including making it as easy as possible to create a clean and visually appealing web page.
Improving quality and accessibility
By providing a toolkit, we can leverage an entire community to gradually enhance the quality of components, including their digital accessibility. Accessibility is a major challenge, and we can aim to provide components that help companies and developers better support it.
How?
By providing:
symfony console ux:toolkit:install Button
command that will generate the corresponding Twig component in the user's project. If necessary, this command will also install any required dependencies (if a component relies on another one).Components will be unique.
It will be possible for the community to distribute unofficial components: for example, the command could accept
symfony console ux:toolkit:install github.com/MyRemote/UiKit:Button
The website https://ux.symfony.com/ will include:
Philosophy
Since the web is constantly evolving, it would be difficult to commit to maintaining components that require frequent updates.
An approach similar to shadcdn seems more suitable: components are generated locally on demand by the developer, who will handle updates if necessary.
This approach likely offers the greatest flexibility: the developer can customize their component as they see fit, add their own variants, and adapt it to their specific needs.
The list of components could be based on the OpenUI initiative, which already provides a solid selection.
The symfony/ux-toolkit package will not be responsible for installing the CSS required for the components to function. It remains the developer's responsibility to manage their assets.
Next steps
There’s still a lot of work to do, which @Kocal will outline shortly. But it would be great to get feedback on the approach.
There is a lot of work to do; if the project is approved and the chosen direction is satisfactory, it would be great to create high-quality components. Looking forward to your feedback!
UX is an amazing component - it just needs "that little extra something" to truly make a difference in the daily lives of Symfony developers. I hope this kind of feature can help achieve that.
Takslist
symfony/ux-toolkit
boilerplatetales-from-a-dev/twig-tailwind-extra
if it wants to fully use our componentsux:toolkit:install
commandux:toolkit:install Button
)ux:toolkit:install github.com/MyRemote/UiKit:Button
)prefix
when installing components, e.g.:<twig:Badge>
must be replaced by<twig:Foobar:Badge>
if the user use the prefixFoobar
.json
containing the list of components, their name, type (component or example/variant), registry dependencies, source code, ... that will be used by theux:toolkit:install
command and the ux.symfony.com website:Registry
andRegistryItem
html_cva
, to provide a good development and customization experience for UX maintainers and usersclass
property, by using the following boilerplate:<div class="{{ style.apply({}, attributes.render('class'))|tailwind_merge }}" {{ attributes.defaults({}).without('class') }}>
tales-from-a-dev/twig-tailwind-extra
non hard-requirement, and what it can provides to userssymfony/ux-toolkit
in dev dependency, run./vendor/symfony/ux-toolkit/bin/generate-registry.php
, ...)